//node js only
function print(o){
    console.log(o);
}
var atom1 ="int add(int a,int b){"+"int c =a+b; return c;} int w = add(1000,100);"

function isDigit(c){
    return !isNaN(c)
}
print("start 1");
//tokens
var t = new Array();
var v =new Array();
//source
var s =atom1;

try{
    for(var i=0;i<atom1.length;i++){
        while(true){
            if(s[i]===' ') {
                print("space");
                i++;
                continue;
            }
            if(isDigit(s[i])){
                var nos = i;
                while(isDigit(s[i])){
                    print("seen digit");
                    i++;
                }
                num=Number(atom(nos,i-1));
                t.push("num")
                v.push(num)
                print(v);
                continue;
            }//num


            //nothing matches
            i++;
            continue;
        }//infinite while
    }//lex for
}catch(e){
    print(e);
}
